package samoloty.data;

import java.util.ArrayList;
import samoloty.model.IDataModel;
import samoloty.model.models.AcRegModel;
import samoloty.model.models.ConfigurationModel;
import samoloty.model.models.ConstModel;
import samoloty.model.models.CrewModel;
import samoloty.model.models.FuelModel;
import samoloty.model.models.HoldsModel;
import samoloty.model.models.IdealTrimModel;
import samoloty.model.models.LimitLawModel;
import samoloty.model.models.LimitTowModel;
import samoloty.model.models.LimitTowffModel;
import samoloty.model.models.LimitZfwModel;
import samoloty.model.models.LimitZfwffModel;
import samoloty.model.models.MaxWeightsModel;
import samoloty.model.models.PantryModel;
import samoloty.model.models.PaxModel;
import samoloty.model.models.StabTrimModel;
import samoloty.model.models.StabTrimSubModel;
import samoloty.model.models.StabTrimSubSubModel;

public class DataBase10 extends CommonDataBase implements IDataModel {

    public DataBase10() {
        super();
        initData();
    }

    public ArrayList<String> getAcReg() {
        return acRegData;
    }

    public ArrayList<ConfigurationModel> getConfiguration() {
        return configuration;
    }

    public ConstModel getConst() {
        return constData;
    }

    public ArrayList<CrewModel> getCrew() {
        return crewData;
    }

    public ArrayList<FuelModel> getFuel() {
        return fuelData;
    }

    public ArrayList<HoldsModel> getHolds() {
        return holdsData;
    }

    public ArrayList<LimitLawModel> getLimitLaw() {
        return limitLawData;
    }

    public ArrayList<LimitTowModel> getLimitTow() {
        return limitTowData;
    }

    public ArrayList<LimitTowffModel> getLimitTowff() {
        return limitTowffData;
    }

    public ArrayList<LimitZfwModel> getLimitZfw() {
        return limitZfwData;
    }

    public ArrayList<LimitZfwffModel> getLimitZfwff() {
        return limitZfwffData;
    }

    public MaxWeightsModel getMaxWeights() {
        return maxWeightsData;
    }

    public PantryModel getPantry() {
        return pantryData;
    }

    public ArrayList<PaxModel> getPax() {
        return paxData;
    }

    public StabTrimModel getStabTrimFlap1() {
        return stabTrimFlap1Data;
    }

    public StabTrimModel getStabTrimFlap2() {
        return stabTrimFlap2Data;
    }

    public StabTrimModel getStabTrimFlap3() {
        return stabTrimFlap3Data;
    }

    public StabTrimModel getStabTrimFlap4() {
        return stabTrimFlap4Data;
    }

    public ArrayList<IdealTrimModel> getIdealTrim() {
        return idealTrimData;
    }

    private void initData() {
        initAcReg();
        initConst();
        initCrew();
        initConfiguratin();
        initFuel();
        initHolds();
        initLimitTow();
        initLimitZfw();
        initPantry();
        initPax();
        initMaxWeights();
        initStabTrimFlap1();
        initIdealTrim();
    }

    private void initAcReg() {
        acRegData = new ArrayList<String>();
        acRegData.add(new String("SP-LPA"));
        acRegData.add(new String("SP-LPB"));
        acRegData.add(new String("SP-LPC"));

    }

    private void initConst() {
        constData = new ConstModel(140000, 55, 972.6, 913.2, 237.5);
    }

    private void initCrew() {
        crewData = new ArrayList<CrewModel>();
        crewData.add(new CrewModel("2/0", 2, 0, 170, -1.083));
        crewData.add(new CrewModel("2/6", 2, 6, 620, -0.807));
        crewData.add(new CrewModel("2/7", 2, 7, 695, -0.438));
        crewData.add(new CrewModel("2/8", 2, 8, 770, -0.853));
        crewData.add(new CrewModel("2/9", 2, 9, 845, -0.484));
        crewData.add(new CrewModel("2/10", 2, 10, 920, -0.900));
        crewData.add(new CrewModel("3/0", 3, 0, 255, -1.624));
        crewData.add(new CrewModel("3/6", 3, 6, 705, -1.348));
        crewData.add(new CrewModel("3/7", 3, 7, 780, -0.979));
        crewData.add(new CrewModel("3/8", 3, 8, 855, -1.395));
        crewData.add(new CrewModel("3/9", 3, 9, 930, -1.026));
        crewData.add(new CrewModel("3/10", 3, 10, 1005, -1.441));
        crewData.add(new CrewModel("4/0", 4, 0, 340, -2.166));
        crewData.add(new CrewModel("4/6", 4, 6, 790, -1.890));
        crewData.add(new CrewModel("4/7", 4, 7, 865, -1.521));
        crewData.add(new CrewModel("4/8", 4, 8, 940, -1.936));
        crewData.add(new CrewModel("4/9", 4, 9, 1015, -1.567));
        crewData.add(new CrewModel("4/10", 4, 10, 1090, -1.983));

    }

    private void initConfiguratin() {
        configuration = new ArrayList<ConfigurationModel>();
        configuration.add(new ConfigurationModel("C18Y229", 18, 229, 18, 60, 0, 82, 0, 87));
        configuration.add(new ConfigurationModel("C18Y225", 18, 225, 18, 60, 0, 82, 0, 83));
        configuration.add(new ConfigurationModel("C17Y225", 17, 225, 17, 60, 0, 82, 0, 83));
        configuration.add(new ConfigurationModel("Y247", 0, 247, 0, 78, 0, 82, 0, 87));
        configuration.add(new ConfigurationModel("C17Y213", 17, 213, 17, 57, 0, 73, 0, 83));
        configuration.add(new ConfigurationModel("C90Y157", 90, 157, 78, 0, 12, 70, 0, 87));
        configuration.add(new ConfigurationModel("C16Y225", 16, 225, 16, 60, 0, 82, 0, 83));
        configuration.add(new ConfigurationModel("C16Y214", 16, 214, 16, 58, 0, 73, 0, 83));
        configuration.add(new ConfigurationModel("C16Y221", 16, 221, 16, 60, 0, 78, 0, 83));

    }

    private void initFuel() {
        fuelData = new ArrayList<FuelModel>();
        fuelData.add(new FuelModel(0, 0));
        fuelData.add(new FuelModel(1500, -1));
        fuelData.add(new FuelModel(5000, -2));
        fuelData.add(new FuelModel(9500, -3));
        fuelData.add(new FuelModel(21500, -2));
        fuelData.add(new FuelModel(24000, -1));
        fuelData.add(new FuelModel(26500, 0));
        fuelData.add(new FuelModel(28000, 1));
        fuelData.add(new FuelModel(29000, 2));
        fuelData.add(new FuelModel(30500, 3));
        fuelData.add(new FuelModel(31500, 4));
        fuelData.add(new FuelModel(32500, 5));
        fuelData.add(new FuelModel(33000, 6));
        fuelData.add(new FuelModel(34000, 7));
        fuelData.add(new FuelModel(34500, 8));
        fuelData.add(new FuelModel(35500, 9));
        fuelData.add(new FuelModel(36000, 10));
        fuelData.add(new FuelModel(36500, 11));
        fuelData.add(new FuelModel(38500, 10));
        fuelData.add(new FuelModel(40000, 9));
        fuelData.add(new FuelModel(41500, 8));
        fuelData.add(new FuelModel(42500, 7));
        fuelData.add(new FuelModel(44000, 6));
        fuelData.add(new FuelModel(45500, 5));
        fuelData.add(new FuelModel(47000, 4));
        fuelData.add(new FuelModel(48500, 3));
        fuelData.add(new FuelModel(50000, 2));
        fuelData.add(new FuelModel(51500, 1));
        fuelData.add(new FuelModel(53000, 0));
        fuelData.add(new FuelModel(54500, -1));
        fuelData.add(new FuelModel(55500, -2));
        fuelData.add(new FuelModel(57000, -3));
        fuelData.add(new FuelModel(58500, -4));
        fuelData.add(new FuelModel(60000, -5));
        fuelData.add(new FuelModel(61500, -6));
        fuelData.add(new FuelModel(63000, -7));
        fuelData.add(new FuelModel(64500, -8));
        fuelData.add(new FuelModel(66000, -9));
        fuelData.add(new FuelModel(67000, -10));
        fuelData.add(new FuelModel(68500, -11));
        fuelData.add(new FuelModel(69500, -12));
        fuelData.add(new FuelModel(71000, -13));
        fuelData.add(new FuelModel(72000, -14));
        fuelData.add(new FuelModel(73104, -15));

    }

    private void initHolds() {
        holdsData = new ArrayList<HoldsModel>();
        holdsData.add(new HoldsModel("1", 8032, -0.00434));
        holdsData.add(new HoldsModel("2", 8032, -0.00253));
        holdsData.add(new HoldsModel("3", 5868, 0.00159));
        holdsData.add(new HoldsModel("4", 7824, 0.00312));
        holdsData.add(new HoldsModel("5", 2915, 0.005));

    }

    private void initLimitZfw() {
        limitZfwData = new ArrayList<LimitZfwModel>();
        limitZfwData.add(new LimitZfwModel(90000, 39.6, 90000, 60.1));
        limitZfwData.add(new LimitZfwModel(133809, 26.2, 133809, 69.0));
    }

    private void initLimitTow() {
        limitTowData = new ArrayList<LimitTowModel>();
        limitTowData.add(new LimitTowModel(90000, 39.6, 90000, 64.0));
        limitTowData.add(new LimitTowModel(133809, 26.2, 133809, 72.9));
        limitTowData.add(new LimitTowModel(138311, 19.3, 181710, 85.6));
        limitTowData.add(new LimitTowModel(181896, 19.4, 185065, 65.6));
        limitTowData.add(new LimitTowModel(185065, 21.4, 185065, 65.6));

    }

     private void initLimitLaw() {
        limitLawData = new ArrayList<LimitLawModel>();
    }

    private void initPantry() {
        pantryData = new PantryModel(1450, -0.00568, 1810, -0.00140, 2270, 0.00516);

    }

    private void initPax() {
        paxData = new ArrayList<PaxModel>();
        paxData.add(new PaxModel("0A", -0.00323));
        paxData.add(new PaxModel("0B", -0.00003));
        paxData.add(new PaxModel("0C", 0.00295));

    }

    private void initMaxWeights() {
        maxWeightsData = new MaxWeightsModel(185519, 185065, 133809, 145149);
    }

    private void initStabTrimFlap1() {
        ArrayList<StabTrimSubModel> stabTrimSub = new ArrayList<StabTrimSubModel>();
        ArrayList<StabTrimSubSubModel> stabMacs1 = new ArrayList<StabTrimSubSubModel>();
        stabMacs1.add(new StabTrimSubSubModel(7, 3.6));
        stabMacs1.add(new StabTrimSubSubModel(27, 0.2));
        stabTrimSub.add(new StabTrimSubModel("FLAPS 5,15, 20", 91000, stabMacs1));
        ArrayList<StabTrimSubSubModel> stabMacs2 = new ArrayList<StabTrimSubSubModel>();
        stabMacs2.add(new StabTrimSubSubModel(7, 4.6));
        stabMacs2.add(new StabTrimSubSubModel(31, 0.2));
        stabTrimSub.add(new StabTrimSubModel("", 109000, stabMacs2));
        ArrayList<StabTrimSubSubModel> stabMacs3 = new ArrayList<StabTrimSubSubModel>();
        stabMacs3.add(new StabTrimSubSubModel(7, 5.5));
        stabMacs3.add(new StabTrimSubSubModel(34, 0.2));
        stabTrimSub.add(new StabTrimSubModel("", 127000, stabMacs3));
        ArrayList<StabTrimSubSubModel> stabMacs4 = new ArrayList<StabTrimSubSubModel>();
        stabMacs4.add(new StabTrimSubSubModel(7, 6.9));
        stabMacs4.add(new StabTrimSubSubModel(37, 0.8));
        stabTrimSub.add(new StabTrimSubModel("", 145000, stabMacs4));
        ArrayList<StabTrimSubSubModel> stabMacs5 = new ArrayList<StabTrimSubSubModel>();
        stabMacs5.add(new StabTrimSubSubModel(9, 7.0));
        stabMacs5.add(new StabTrimSubSubModel(37, 1.4));
        stabTrimSub.add(new StabTrimSubModel("", 163000, stabMacs5));
        ArrayList<StabTrimSubSubModel> stabMacs6 = new ArrayList<StabTrimSubSubModel>();
        stabMacs6.add(new StabTrimSubSubModel(12, 7.0));
        stabMacs6.add(new StabTrimSubSubModel(37, 1.7));
        stabTrimSub.add(new StabTrimSubModel("", 181000, stabMacs6));
        ArrayList<StabTrimSubSubModel> stabMacs7 = new ArrayList<StabTrimSubSubModel>();
        stabMacs7.add(new StabTrimSubSubModel(12, 7.0));
        stabMacs7.add(new StabTrimSubSubModel(37, 1.8));
        stabTrimSub.add(new StabTrimSubModel("", 186000, stabMacs7));
        stabTrimFlap1Data = new StabTrimModel(stabTrimSub);
    }

    private void initIdealTrim() {
        idealTrimData = new ArrayList<IdealTrimModel>();
        idealTrimData.add(new IdealTrimModel(90000, 61));
        idealTrimData.add(new IdealTrimModel(133809, 64));

    }

    public String getLabel() {
        return "B767-300ER";
    }
    private ArrayList<String> acRegData;
    private ConstModel constData;
    private ArrayList<CrewModel> crewData;
    private ArrayList<ConfigurationModel> configuration;
    private ArrayList<FuelModel> fuelData;
    private ArrayList<HoldsModel> holdsData;
    private ArrayList<LimitZfwModel> limitZfwData;
    private ArrayList<LimitTowModel> limitTowData;
    private ArrayList<LimitLawModel> limitLawData;
    private ArrayList<LimitZfwffModel> limitZfwffData;
    private ArrayList<LimitTowffModel> limitTowffData;
    private PantryModel pantryData;
    private ArrayList<PaxModel> paxData;
    private MaxWeightsModel maxWeightsData;
    private StabTrimModel stabTrimFlap1Data;
    private StabTrimModel stabTrimFlap2Data;
    private StabTrimModel stabTrimFlap3Data;
    private StabTrimModel stabTrimFlap4Data;
    private ArrayList<IdealTrimModel> idealTrimData;
}
